import Vue from 'vue'
import VueRouter from 'vue-router'

// 导入 login
const login = () => import('../views/login/login.vue')
const search = () => import('../views/box/search/search.vue')
const searchList = () => import('../views/box/search/searchList.vue')
const home = () => import('../views/box/home/home.vue')
const my = () => import('../views/box/my/my.vue')
const userInfo = () => import('../views/box/my/userInfo.vue')
const ask = () => import('../views/box/ask/ask.vue')
const avideo = () => import('../views/box/avideo/avideo.vue')
const box = () => import('../views/box/box.vue')

Vue.use(VueRouter)

const routes = [
  {
    path: '/login',
    component: login
  },

  {
    path: '/box',
    component: box,
    children: [
      {
        path: '/box/home',
        component: home,
        meta:{
          needTab:true
        }
      },
      {
        path: '/box/search',
        component: search
      },
      {
        path: '/box/searchList',
        component: searchList
      },
      {
        path: '/box/my',
        component: my,
        meta:{
          needTab:true
        }
      },
      {
        path: '/box/userInfo',
        component: userInfo
      },
      {
        path: '/box/avideo',
        component: avideo,
        meta:{
          needTab:true
        }
      },
      {
        path: '/box/ask',
        component: ask,
        meta:{
          needTab:true
        }
      }
    ]
  }

 
]

const router = new VueRouter({
  routes
})

export default router
